﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Administration/main.master" AutoEventWireup="true"
    CodeBehind="MaintenanceStaff_ViewEditDateStatus.aspx.cs" Inherits="CS424_9pts.Administration.MaintenanceStaff_ViewEditDateStatus" %>

<asp:Content ID="Content1" ContentPlaceHolderID="cph1" runat="server">
    <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataKeyNames="MaintenanceID"
        DataSourceID="SqlDataSource1">
        <Columns>
            <asp:TemplateField SortExpression="MaintenanceID" HeaderText="MaintenanceID">
                <EditItemTemplate>
                    <asp:Label runat="server" ID="Mid" Text='<%# Bind("MaintenanceID")%>'></asp:Label>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" ID="XXX" Text='<%# Bind("MaintenanceID") %>'></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:BoundField DataField="DateToCompany" HeaderText="DateToCompany" SortExpression="DateToCompany"
                ReadOnly="true" />
            <asp:BoundField DataField="DateBackToCompany" HeaderText="DateBackToCompany" SortExpression="DateBackToCompany"
                ReadOnly="true" />
            <asp:BoundField DataField="DateToManufacturer" HeaderText="DateToManufacturer" SortExpression="DateToManufacturer"
                ReadOnly="true" />
            <asp:BoundField DataField="DateBackToCustomer" HeaderText="DateBackToCustomer" SortExpression="DateBackToCustomer"
                ReadOnly="true" />
            <asp:TemplateField SortExpression="Status" HeaderText="Status">
                <EditItemTemplate>
                    <asp:DropDownList ID="DropDownList1" runat="server" OnSelectedIndexChanged="OnSelectedIndexChanged">
                        <asp:ListItem>  ------------------   </asp:ListItem>
                        <asp:ListItem>  Mới nhận xe của KH   </asp:ListItem>
                        <asp:ListItem>  Giao xe cho TTBT   </asp:ListItem>
                        <asp:ListItem>  Xe về công ty   </asp:ListItem>
                        <asp:ListItem>  Done!!!   </asp:ListItem>
                    </asp:DropDownList>
                </EditItemTemplate>
                <ItemTemplate>
                    <asp:Label runat="server" Text='<%# Bind("Status") %>' ID="Label1"></asp:Label>
                </ItemTemplate>
            </asp:TemplateField>
            <asp:CommandField ShowEditButton="True" />
            <asp:TemplateField HeaderText="Note">
                <ItemTemplate>
                    <asp:HyperLink runat="server" NavigateUrl='<%#"Maintenance_AddMaintenanceNote.aspx?id=" + Eval("MaintenanceID")%>'
                        ID="hpLink">Click here to Read</asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
    </asp:GridView>
    <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:CarManagementConnectionString %>"
        
        
    SelectCommand="SELECT Maintenance.MaintenanceID, Maintenance.DateToCompany, Maintenance.DateToManufacturer, Maintenance.DateBackToCompany, Maintenance.Status, Maintenance.DateBackToCustomer, aspnet_Users.UserName, aspnet_Membership.Email FROM Maintenance INNER JOIN Contract ON Maintenance.ContractID = Contract.ContractID INNER JOIN aspnet_Users ON Contract.StaffID = aspnet_Users.UserId AND Contract.CustomerID = aspnet_Users.UserId INNER JOIN aspnet_Membership ON aspnet_Users.UserId = aspnet_Membership.UserId AND aspnet_Users.UserId = aspnet_Membership.UserId">
    </asp:SqlDataSource>

    </asp:Content>

